package in.waffl.fairycake;

import java.util.Comparator;

public class DrawableComparator implements Comparator<Drawable> {
	public int compare(Drawable o1, Drawable o2) {
		if (o1 == null || o2 == null) return 0;
		if (o1.depth > o2.depth) return -1;
		if (o1.depth < o2.depth) return 1;
		if (o1.creationTime > o2.creationTime) return -1;
		if (o1.creationTime < o2.creationTime) return 1;
		return 0;
	}
}